package com.beamfield.dao.sys;

import com.beamfield.model.ProjectDetail;
import com.beamfield.modelVo.FrameBeamVo;
import com.beamfield.modelVo.ProjectDetailVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public interface ProjectDetailMapper {
    int deleteByPrimaryKey(Long project_detail_id);

    int insert(ProjectDetail record);

    int insertSelective(ProjectDetail record);

    ProjectDetail selectByPrimaryKey(Long project_detail_id);

    int updateByPrimaryKeySelective(ProjectDetail record);

    int updateByPrimaryKey(ProjectDetail record);

    @Delete("delete from  t_project_detail where project_id =#{0} and beam_id = #{1}")
    int deleteByProjectId(Long pid, Long beamId);

    List<ProjectDetail> selectByProjectId(@Param("projectId") String projectId,
                                          @Param("productId") String productId,
                                          @Param("offset") String offset,
                                          @Param("limit") String limit,
                                          @Param("beamId") Long beamId);


    long countByProjectId(@Param("projectId") String projectId,
                          @Param("productId") String productId,
                          @Param("beamId") Long beamId);

    int insertList(List<ProjectDetail> projectDetailList);

    int countByBeamNoLike(@Param("beamId") Long beamId,@Param("span") String span);

    String selectJointName(@Param("beamId") Long beamId);

    List<ProjectDetail> selectByBeamId(@Param("beamId") Long beamId);

    List<ProjectDetailVo> selectByBeamIdVo(@Param("beamId") Long beamId);

    List<ProjectDetail> selectUnproduced(@Param("projectId") String projectId, @Param("beamNoList") List<String> beamNoList, @Param("beamId") Long beamId);

    List<ProjectDetail> selectByMonth(@Param("month")String month, @Param("beamId")Long beamId);

    List<ProjectDetail> selectByBeamNoAndBeamId(@Param("beamNo") String beamNo,@Param("beamId") Long beamId);

    List<FrameBeamVo> readFrameBeamData(@Param("beamId") Long beamId,@Param("offset") String offset,@Param("limit") String limit);

    Long countFrameBeamData(@Param("beamId") Long beamId);

    List<ProjectDetail> selectByProductId(@Param("pid") String pid);
}
